package com.hxzy.three.service.impl;

import com.hxzy.three.dao.UserDao;
import com.hxzy.three.dao.impl.UserDaoImpl;
import com.hxzy.three.entity.User;
import com.hxzy.three.service.UserService;

/**
 * @author wzm
 * @create 2023-09-20 14:41
 * project_name:javaweb2308
 */
//UserService接口的实现类  完成具体的功能
public class UserServiceImpl implements UserService {
    //创建Dao对象
    UserDao userDao = new UserDaoImpl();
    @Override
    public boolean register(User user) {
        //通过dao对象调用dao中的方法
        return userDao.inserUser(user) > 0;
    }

    @Override
    public User login(User login) {
        return userDao.selectByNameAndPwd(login);
    }

}
